<!--四性检测-->
<template>
  <div class="safe-testing">
    <div class="safe-head">
      <div class="head-left">
        <div class="cricle-rotate"></div>
        {{ percent }}
      </div>
      <div class="head-right">
        <div class="test-top">
          <div class="test-title">正在检测...</div>
          <a-button>取消</a-button>
        </div>
        <div class="test-content">检查恶意软件:D\20190923\ZHKF\node_modules\core-js\fn</div>
        <a-progress :percent="percent" :show-info="false" />
      </div>
    </div>
    <a-divider />
    <div class="check-content">
      <a-row :gutter="16">
        <a-col
          :span="12"
          v-for="(item, index) in checkList"
          :key="index">
          <div
            class="list"
            :style="{ marginBottom: (index <= 1 ? '10px' : '0') }">
            <span v-if="item.status === 2"></span>
            <span v-if="item.status === 2"></span>
            <span v-if="item.status === 2"></span>
            <span v-if="item.status === 2"></span>
            <div class="list-icon">
              <icon-font :type="item.icon" :style="{color: (item.status === 1 ? '#d9d9d9' : '#13c2c2') }" />
            </div>
            <div class="list-title">{{ item.title }}</div>
            <div class="list-status" v-if="item.status === 1">等待检测</div>
            <div class="list-status" v-if="item.status === 2">正在检测...</div>
            <div class="list-status" v-if="item.status === 3" style="color: #13c2c2;">检测完成</div>
          </div>
        </a-col>
      </a-row>
    </div>
  </div>
</template>

<script>
export default {
  name: '',
  components: {
  },
  data () {
    return {
      percent: 0, // 进度条百分比
      checkList: [
        {
          status: 3,
          icon: 'icon-danganjieshou',
          title: '真实性检测内容'
        },
        {
          status: 2,
          icon: 'icon-sousuo1',
          title: '完整性检测内容'
        },
        {
          status: 1,
          icon: 'icon-anquan',
          title: '可用性检测内容'
        },
        {
          status: 1,
          icon: 'icon-jiandingjigou',
          title: '安全性检测内容'
        }
      ]
    }
  },
  created () {
    setInterval(() => {
      let percent = this.percent + 1
      if (percent > 100) {
        percent = 100
      }
      this.percent = percent
    }, 1000)
  },
  mounted () {
  },
  methods: {
  }
}
</script>

<style lang="less" scoped>
.safe-testing {
  padding: 24px;
  .safe-head {
    height: 100px;
    padding: 0 20px;
    display: flex;
    align-items: center;
    .head-left {
      height: 80px;
      width: 80px;
      margin-right: 40px;
      color: #13c2c2;
      text-align: center;
      line-height: 80px;
      font-size: 30px;
      position: relative;
      .cricle-rotate {
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        border: 1px dashed #13c2c2;
        animation: rotate 1s linear infinite;
      }
    }
    .head-right {
      flex: 1;
      .test-top {
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        .test-title {
          font-size: 30px;
          color: #515151;
          font-weight: 700;
        }
      }
      .test-content {
        font-size: 18px;
        color: #a0a0a0;
      }
    }
  }
  .check-content {
    .list {
      height: 150px;
      background: #fdfdfd;
      border: 2px solid #e8e8e8;
      display: flex;
      flex-direction: column;
      justify-content: center;
      align-items: center;
      position: relative;
      overflow: hidden;
      &>span:nth-child(1) {
        position: absolute;
        top: 0;
        left: -100%;
        width: 100%;
				height: 2px;
        background: linear-gradient(90deg, transparent, #13c2c2);
        animation: btn-anim1 2s linear infinite;
      }
      &>span:nth-child(2) {
        position: absolute;
				top: -100%;
				right: 0;
				width: 2px;
				height: 100%;
				background: linear-gradient(180deg, transparent, #13c2c2);
				animation: btn-anim2 2s linear infinite;
				animation-delay: .5s
      }
      &>span:nth-child(3) {
        position: absolute;
				bottom: 0;
				right: -100%;
				width: 100%;
				height: 2px;
        background: linear-gradient(270deg, transparent, #13c2c2);
				animation: btn-anim3 2s linear infinite;
				animation-delay: 1s
      }
      &>span:nth-child(4) {
        position: absolute;
				bottom: -100%;
				left: 0;
				width: 2px;
				height: 100%;
				background: linear-gradient(360deg, transparent, #13c2c2);
				animation: btn-anim4 2s linear infinite;
				animation-delay: 1.5s
			}
      .list-icon {
        .anticon {
          font-size: 40px;
        }
      }
      .list-title {
        font-size: 18px;
        line-height: 30px;
        color: #444;
      }
      .list-status {
        font-size: 14px;
        color: #777;
      }
    }
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }
  50% {
    transform: rotate(-180deg);
  }
  100% {
    transform: rotate(-360deg);
  }
}

@keyframes btn-anim1 {
  0% {
    left: -100%;
  }
  50%,
  100% {
    left: 100%;
  }
}
@keyframes btn-anim2 {
  0% {
    top: -100%;
  }
  50%,
  100% {
    top: 100%;
  }
}
@keyframes btn-anim3 {
  0% {
    right: -100%;
  }
  50%,
  100% {
    right: 100%;
  }
}
@keyframes btn-anim4 {
  0% {
    bottom: -100%;
  }
  50%,
  100% {
    bottom: 100%;
  }
}
</style>
